home *** CD-ROM | disk | FTP | other *** search
- /* Horizontal Scroll 640
- ** ---------------------
- ** This opens an extra wide screen of 256x640 pixels, and hardware scrolls
- ** left and right. This is *totally* inadequate for platformers, shoot'em-ups
- ** etc because the picture size takes up huge amounts of memory. However for
- ** games like Skidmarks, Lemmings, Monkey Island, etc, such large screens can
- ** be a necessity.
- */
-
- MODULE 'games','games/games'
-
- PROC main()
- DEF screen:PTR TO gamescreen, palette:PTR TO INT, direction=1:LONG,
- loadpic:PTR TO picture
-
- palette := [ $0000,$0400,$0501,$0501,$0601,$0701,$0701,$0801,
- $0901,$0A01,$0B02,$0432,$0CC0,$0F00,$0211,$0880
- ]:INT;
-
- screen := [ GSV1,0,
- 0,0,0, -> Screen_Mem1/2/3
- 0, -> Screen link.
- palette, -> Address of palette.
- 0, -> Address of rasterlist.
- 16, -> Amt of colours in palette.
- 320,256,640,256, -> Screen & Pic Height/Width
- 4, -> Amt of planes.
- 0,0, -> Top of screen offsets, X/Y
- 0,0, -> X/Y counters (for scrolling).
- HSCROLL, -> Special attributes.
- LORES, -> Screen mode.
- INTERLEAVED, -> Screen type
- 0 -> Reserved area.
- ]:gamescreen;
-
- loadpic := [ PCV1,0, -> Version header.
- 0, -> Destination.
- 640,256, -> Width, Height.
- 4, -> Amount of Planes.
- 16, -> Amount of colours.
- palette, -> Palette (remap).
- LORES, -> Screen mode.
- INTERLEAVED, -> Destination.
- 0 -> Parameters.
- ]:picture;
-
- IF gmsbase := OpenLibrary('games.library',0)
- SetUserPri()
- IF (Add_Screen(screen) = ERR_OK)
- loadpic.data := screen.memptr1;
- IF (LoadPic('GAMESLIB:data/IFF.Pic640x256',loadpic) = ERR_OK)
- Show_Screen(screen)
- REPEAT
- Wait_OSVBL()
- IF (screen.picxoffset = 320) THEN direction := -1
- IF (screen.picxoffset = 0) THEN direction := 1
- screen.picxoffset := screen.picxoffset+direction
- Move_Picture(screen)
- UNTIL !(Read_Mouse(JPORT1) AND MB_LMB)
- ENDIF
- Delete_Screen(screen)
- ENDIF
- CloseLibrary(gmsbase)
- ENDIF
- ENDPROC
-